package com.chenlonghai.sbmybatis.controller;



import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.chenlonghai.sbmybatis.entity.AppModelTest;
import com.chenlonghai.sbmybatis.entity.Cases;
import com.chenlonghai.sbmybatis.entity.Person;
import com.chenlonghai.sbmybatis.entity.ResultModel;
import com.chenlonghai.sbmybatis.service.HoldingsService;

import net.sf.json.JSONObject;

@RestController
@RequestMapping("/unlogin")
public class HelloController {
	
	@RequestMapping(value="/log")
	public String handllogin(){
		
	   AppModelTest<String>appmodel = new AppModelTest<String>("未登录", new HashMap<String,Object>());
		System.out.println(JSONObject.fromObject(appmodel.getResultMap()).toString(4));
		return JSONObject.fromObject(appmodel.getResultMap()).toString(4);
	}
//	@Autowired
//	private HoldingsService areaService;
//	@Autowired
//	private Person person;
//	
//	@Value("${testValue}")
//	private String testValue;
//	
//	@RequestMapping(value= {"/hello","/hi"},method = RequestMethod.GET)
//	public String hello() {
//		List<Cases>list = areaService.queryArea();
//		System.out.println(list.size());
//		return "hello==" +"age"+ person.getAge() +"name:"+person.getName() +"===="+testValue;
//	}
//	/** Controller的使用
//	 * @PathVariable 获取url的数据
//	 * @RequestParam 获取请求参数的值
//	 *@GetMapping 组合注解
//	 *
//	 * */
//
//	@RequestMapping(value= {"/{name}/say/{id}"},method = RequestMethod.GET)
//	public String test(@PathVariable("id") Integer id,@PathVariable("name") String name) {
//
//		return "PathVariable获取id-->"+id + "获取的name-->"+name;
//	}
//	
////	@RequestMapping(value= {"/say"},method = RequestMethod.GET)
////	@PostMapping
//	@GetMapping(value="/say")
//	public String test1(ç Integer id) {
////		(@RequestParam("id")
//		return "RequestParam获取id-->"+id ;
//	}
	
}
